<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of enquiry_model
 *
 * @author chandu
 */
class enquiry_model extends model {

    private $name;
    private $father;
    private $admtoclass;
    private $preschool;
    private $address;
    private $street;
    private $area;
    private $status;
    private $phone;
    private $mobile;
    private $remarks;
    private $coordinator;
    private $data;
    private $chk;
    private $mod;
    public $moduleName;
    public $keyFields;

  
    public function getKeyFields() {
        return $this->keyFields;
    }

    public function enquiry_display($table) {
        //$this->db = new dbconfig();

        $this->query = "SELECT * FROM $table ORDER BY enqdate DESC";
        //$this->result = mysql_query($this->query);
        $this->result2 = $this->execute($this->query);
        while ($this->result_data = $this->fetch_array($this->result2)) {
            $data[] = $this->result_data;
        }
        return $data;
    }

    public function enquiry_display_recent($table) {
        //$this->db = new dbconfig();
        //$this->query = "SELECT * FROM $table";
        $this->query = "SELECT * 
FROM $table
ORDER BY enqdate DESC LIMIT 10";
       // $this->result = mysql_query($this->query);
           $this->result2 = $this->execute($this->query);
       while ($this->result_data = $this->fetch_array($this->result2)) {
            $data[] = $this->result_data;
        }
        return $data;
    }

    public function enq_detail_display($table, $id) {

        $this->query = "SELECT * FROM $table WHERE enqno = '$id'";

      $this->result2 = $this->execute($this->query);
        $this->result_data = $this->fetch_array($this->result2);
        $data[] = $this->result_data;

        return $data;
    }

}
